﻿@model Zatify.Domain.Data.Business
@{
    ViewBag.Title = "MoreInfo";
    Layout = "~/Views/Shared/_MainLayout.cshtml";
}
<style type="text/css">
    .inner_container
    {
        float: none;
    }
</style>
@helper GetHours()
    {
    <div class="info_business_hour">
        @if (!Model.BusinessHours.MonClosed)
        {
            <span class="days">Mon</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.MonFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.MonTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Mon</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>
    <div class="info_business_hour">
        @if (!Model.BusinessHours.TueClosed)
        {
            <span class="days">Tue</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.TueFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.TueTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Tue</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>
    <div class="info_business_hour">
        @if (!Model.BusinessHours.WedClosed)
        {
            <span class="days">Wed</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.WedFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.WedTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Wed</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>
    <div class="info_business_hour">
        @if (!Model.BusinessHours.ThuClosed)
        {
            <span class="days">Thu</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.ThuFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.ThuTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Thu</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>
    <div class="info_business_hour">
        @if (!Model.BusinessHours.FriClosed)
        {
            <span class="days">Fri</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.FriFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.FriTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Fri</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>  
    <div class="info_business_hour">
        @if (!Model.BusinessHours.SatClosed)
        {
            <span class="days">Sat</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.SatFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.SatTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Sat</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>
    <div class="info_business_hour">
        @if (!Model.BusinessHours.SunClosed)
        {
            <span class="days">Sun</span><span class="collon">:</span> <span class="b_hour">@DateTime.Today.Add(Model.BusinessHours.SunFrom).ToString("hh:mm tt")
                - @DateTime.Today.Add(Model.BusinessHours.SunTo).ToString("hh:mm tt")</span>
        }
        else
        {
            <span class="days">Sun</span><span class="collon">:</span> <span class="b_hour">Closed</span>
        }
    </div>
}
<div class="wrapper">
    <!--inner container-->
    <div class="inner_container">
        <h2>
            @Model.BusinessName
            <p class="sub_title_hd">@Model.StreetAddress1<span class="distance">
                @if (Model.Distance.HasValue)
                { 
                    @Model.Distance.Value.ToString("0.00")<text>mi</text>
                }
                else
                {
                    <text>N/A</text> 
                }
            </span>
            </p>
        </h2>
        <div class="details_banner" style="text-align: center; vertical-align: middle;">
            <img alt="" src="@Url.Action("GetBusinessPhoto", "UserProfile", new { businessId = Model.BusinessId, w = 940, h = 350 })" />
        </div>
        <div class="deal_more_info">
            <h3>
                Business Description</h3>
            <a href="@Url.Action("BusinessReviews", "UserProfile", new { businessId = Model.BusinessId })" class="blue_btn review_blue_btn">
                Reviews</a>
            <div class="more_info_hour">
                <h4>
                    Business Hours:</h4>
                @GetHours()
            </div>
        </div>
    </div>
    <!--end inner container-->
    <div class="clearfix">
    </div>
</div>
